//------------------------------------------------------------------------
/*
	Author:	Philipp Hannemann
	Date:	02.11.2012
	Beschreibung: 
		
*/
//------------------------------------------------------------------------
#ifndef InputEventReceiver_h_
#define InputEventReceiver_h_ InputEventReceiver_h_
//------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------
#include <irrlicht.h>
//------------------------------------------------------------------------
// Macros
//------------------------------------------------------------------------

//------------------------------------------------------------------------
// Misc
//------------------------------------------------------------------------
using namespace irr;
//------------------------------------------------------------------------
class InputEventReceiver : public IEventReceiver
{
public:
	struct SMouseState
	{
		bool LeftButtonDown;
		bool RightButtonDown;
		SMouseState() : LeftButtonDown(false), RightButtonDown(false) { }
	};

public:
	InputEventReceiver(void);
	~InputEventReceiver(void);

	// This is the one method that we have to implement
	virtual bool OnEvent(const SEvent& event);

	// This is used to check whether a key is being held down
	virtual bool IsKeyDown(EKEY_CODE keyCode) const;
	virtual bool IsKeyJustPressed(EKEY_CODE keyCode) const;
	
	const SMouseState & InputEventReceiver::GetMouseState(void) const;

public:
	SMouseState MouseState;

	// We use this array to store the current state of each key
	bool KeyIsDown[KEY_KEY_CODES_COUNT];
};
//------------------------------------------------------------------------
#endif // InputEventReceiver_h_
